package com.ruoyi.binance.controller;

import com.ruoyi.binance.api.AccountApi;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * AI 选股Controller
 *
 * @author zq
 * @date 2025-08-01
 */
@RestController
@RequestMapping("/binance/account")
public class AccountController extends BaseController {


    @PreAuthorize("@ss.hasPermi('binance:account:list')")
    @GetMapping("/list")
    public AjaxResult list(String code) {
        if (StringUtils.isEmpty(code)){
            return success(AccountApi.account());
        }else {
            return success(AccountApi.getAccountByCode(code));
        }
    }
}
